/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package DBFunction;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.json.JSONException;
import org.json.JSONObject;

public class fCurrentUser {
	public static String process(String currentPhoneNumber)
			throws JSONException {

		JSONObject object = new JSONObject();
		// get buddies of person form same group
		String sql = "SELECT PhoneNumber,FirstName,LASTName from buddytracking.user where PhoneNumber = '"
				+ currentPhoneNumber + "'";
		ResultSet resultSet = DB.connectDB.ExecuteQuery(sql);

		try {
			while (resultSet.next()) {
				object.put("firstname", resultSet.getString("FirstName"));
				object.put("lastname", resultSet.getString("LastName"));
			}
		} catch (SQLException ex) {
		}
		return object.toString();
	}
}
